/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.synjones.zeus.model;

import com.synjones.core.bean.TimePattern;
import com.synjones.core.util.DateUtil;
import lombok.Data;

@Data
public class ExRespBean<T> {

    private String errCode;
    private String errMsg;
    private String tipMsg;
    private String time = DateUtil.genCurDateStr(TimePattern.TIME_PATTERN);
    private T data;

    public ExRespBean() {

    }

    public ExRespBean(String errCode, String tipMsg) {
        this.errCode = errCode;
        this.tipMsg = tipMsg;
    }

    public ExRespBean(String errCode, String tipMsg, T data) {
        this.errCode = errCode;
        this.tipMsg = tipMsg;
        this.data = data;
    }
    
    public ExRespBean(String errCode, String errMsg, String tipMsg, String time) {
        this.errCode = errCode;
        this.errMsg = errMsg;
        this.tipMsg = tipMsg;
        this.time = time;
    }
    
    public Boolean statusOk() {
        return StatusInfo._0000.code().equals(this.getErrCode());
    }
}
